package com.avic.process.export.util;

import java.util.ArrayList;
import java.util.Iterator;

import com.teamcenter.rac.kernel.TCComponentBOMLine;

public abstract class CollectedItem
{
	public String itemID;
	public String name;
	public String compcode;
	public boolean isInitialize;
	
	public CollectedItem(TCComponentBOMLine bomline)
	{
		setCollectedItem(bomline);
	}
	
	protected abstract void setCollectedItem(TCComponentBOMLine bomline);

	public void addtoList(ArrayList<CollectedItem> alItem)
	{
		boolean exist = false;
		for (Iterator<CollectedItem> iterator = alItem.iterator(); iterator.hasNext();)
		{
			CollectedItem collectedItem = iterator.next();
			if (collectedItem.itemID.equals(itemID))
			{
				exist = true;
				break;
			}
		}
		if (!exist)
		{
			alItem.add(this);
		}
	}
}
